import requests

print(type(open('python从菜鸟到高手.png','rb')))

#定义要上传的文件
file1={'file':open('python从菜鸟到高手.png','rb')}

#将本地文件上传到upload——server。py上
r1=requests.post('http://127.0.0.1:5000',files=file1)
#输出响应结果
print(r1.text)

files2={'file':open('python从高手到菜鸟.png','rb')}
r2=requests.post('http://httpbin.org/post',files=files2)
print(r1.text)